#include<sys/types.h>
#include<sys/socket.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<netinet/in.h>
#include<netinet/ip.h>
#include<arpa/inet.h>
#include<unistd.h>

struct password
{
	char id[20];
	char passwd[20];
	int flag;
};

void online_member(int connectfd)
{
	struct password pw;
	char buf[20];
	memset(&pw,0,sizeof(pw));
	pw.flag=5;
	send(connectfd,&pw,sizeof(pw),0);
	printf("当前在线用户：\n");
	int i=0;
	while(1)
	{
		memset(buf,'\0',sizeof(buf));
		recv(connectfd,buf,sizeof(buf),0);
		if(strcmp(buf,"end")==0)
		{
			break;	
		}
		else
		{
			printf("%s\n",buf);
			i++;
		}
	}
	printf("共%d人\n",i);

	
}
